#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START debugedit
# depends: cross-pkg-config
# depends: elfutils
# why: rpm-build run-time dependency

reset_mtime debugedit debugedit/configure.ac
rm -rf build/debugedit
mkdir -p build/debugedit
cd build/debugedit
cat > config.cache <<-EOF
ac_cv_func_malloc_0_nonnull=yes
ac_cv_func_realloc_0_nonnull=yes
EOF
env \
	CROSS_READELF=${TARGET}-readelf \
../../debugedit/configure \
	${CONFIGURE_ARGS} \
	--cache=config.cache \
	${AUTOCRAP_KLUDGE}

make -j${JOBS} V=1
make -j${JOBS} install DESTDIR="$stage"
wipe_la_files "$stage"
cd ../..
rm -rf build/debugedit

# RECIPE END debugedit
